
(function() {
    var D = TED.EditorCore, extend = TED.extend, A = TED.EditorInstanceManager, B = TED.augmentObject;
    window.TED["SimpleEditor"] = C;
    function C(F) {
        C.superclass.call(this, F)
    }
    C.defaultConfig = {
		height: "100px",
		width: "400px",
		maxHeight: null,
		autoFocus: true,
		autoEnable: true,
		autoHeight: false,
		wrapperClassName: "tb-simpleeditor-wrapper",
		editAreaClassName: "tb-editor-editarea",
		editAreaWrapperClassName: "tb-editor-editarea-wrapper",
		disabledEditAreaClassName: "tb-editor-editarea tb-editor-editarea-disabled",
		disabledWrapperClassName: "tb-simpleeditor-wrapper tb-simpleeditor-wrapper-disabled",
		imageClassName: "BDE_Image",
		smileyClassName: "BDE_Smiley",
		rootPath: "/tb/editor/v2/",
		enableRefer: true,
		emptyClassName: "BDE_Empty",
		flashClassName: "BDE_Flash",
		flashNumLimit: 10,
		didaDelay: 300,
		imageWidthLimit: 570
	};
    extend(C, D, {getContentLength: function() {
            return Math.ceil(this.filteHTML(this.editArea.innerHTML, ["img", "br"]).replace(/<img[^>]*>/gi, "mm").replace(/<br[^>]*>/gi, "m").replace(/&nbsp;/gi, "m").replace(/[^\x00-\xff]/g, "mm").length / 2)
        },filteEditHTML: function() {
            return html = this.editArea.innerHTML.replace(/_moz_dirty=""/gi, "").replace(/\[/g, "[[-").replace(/\]/g, "-]]").replace(new RegExp("<\\/?(?:br[^>]*)>", "gi"), "[$1]").replace(new RegExp('<span([^>]*class="?at"?[^>]*)>', "gi"), "[span$1]").replace(new RegExp('<img([^>]*class="?(?:' + this.config.emptyClassName + "|" + this.config.smileyClassName + ')"?[^>]*)>', "gi"), "[img$1]").replace(/<[^>]*>/g, "").replace(/\[\[\-/g, "[").replace(/\-\]\]/g, "]").replace(new RegExp("\\[(/?(?:br|img|span)[^\\]]*)\\]", "gi"), "<$1>")
        },filteSubmitHTML: function() {
            this.reLayout();
            var G = this.editArea.innerHTML.replace(/_moz_dirty=""/gi, "").replace(/\[/g, "[[-").replace(/\]/g, "-]]").replace(new RegExp("<(/?(?:" + this.submitValidHTML.join("|") + ")[^>]*)>", "gi"), "[$1]").replace(new RegExp('<img([^>]*class="?(?:' + this.config.imageClassName + "|" + this.config.smileyClassName + "|" + this.config.flashClassName + "|" + this.config.musicClassName + ')"?[^>]*)>', "gi"), "[img$1]").replace(/<[^>]*>/g, "").replace(/\[\[\-/g, "[").replace(/\-\]\]/g, "]").replace(new RegExp("\\[(/?(?:" + this.submitValidHTML.join("|") + "|img)[^\\]]*)\\]", "gi"), "<$1>");
            var F = document.createElement("div");
            F.innerHTML = G;
            this.parseURL(F);
            return F.innerHTML
        }});
    B(C, A)
})();


(function() {
    var G = TED.EditorCore, I = TED.extend, C = TED.EventDispatcher, A = TED.Overlay, D = TED.HoverOverlay, J = TED.Event, K = TED.EditorInstanceManager, H = TED.augmentObject, B = TED.SimpleAjax;
    window.TED["Editor"] = F;
    function F(L) {
        if (this.ua.mobile || this.isUCWeb() || this.isAndroidOS()) {
            return new TED.TextInput(L)
        }
        F.superclass.call(this, L)
    }
    F.defaultConfig = {height: "200px",width: "655px",maxHeight: null,autoFocus: false,autoEnable: true,autoHeight: true,wrapperClassName: "tb-editor-wrapper",editAreaClassName: "tb-editor-editarea",editAreaWrapperClassName: "tb-editor-editarea-wrapper",disabledEditAreaClassName: "tb-editor-editarea tb-editor-editarea-disabled",disabledWrapperClassName: "tb-editor-wrapper tb-editor-wrapper-disabled",imageClassName: "BDE_Image",smileyClassName: "BDE_Smiley",musicClassName: "BDE_Music",flashClassName: "BDE_Flash",flashNumLimit: 10,rootPath: "/tb/editor/v2/",enableRefer: true,emptyClassName: "BDE_Empty",didaDelay: 300,imageWidthLimit: 570};
    F.Status = {isPicassoOpen: false};
    I(F, G, {getHtml: function() {
            return this.img2embed(F.superclass.prototype.getHtml.call(this, this.editArea.innerHTML))
        },hasPicassoAuth: function() {
            if (this.config.picasso) {
                return true
            }
            return false
        },enable: function() {
            this.toolbar.enable();
            F.superclass.prototype.enable.call(this)
        },disable: function() {
            this.toolbar.disable();
            if (this.overlay.isOpen) {
                this.overlay.close()
            }
            F.superclass.prototype.disable.call(this)
        },getFlashNum: function() {
            return this.getTagNum("img", "BDE_Flash")
        },getMusicNum: function() {
            return this.getTagNum("img", "BDE_Music")
        },getConfig: function() {
            return this.config
        },overlay: null,toolbar: null,hoveroverlay: null,initComponents: function(L) {
            F.superclass.prototype.initComponents.call(this, L);
            this.overlay = new A(this.wrapper);
            this.hoveroverlay = new D(this.wrapper);
            this.toolbar = new E(this.wrapper, this.hasPicassoAuth())
        },attachEvents: function() {
            F.superclass.prototype.attachEvents.call(this);
            this.toolbar.on("command", this.toolbarcmd, this);
            this.toolbar.on("hovercommand", this.toolbarhovercmd, this);
            this.toolbar.on("hoverendcommand", this.toolbarhoverendcmd, this);
            this.overlay.on("close", function() {
                this.focus()
            }, this)
        },detachEvents: function() {
            F.superclass.prototype.detachEvents.call(this);
            this.toolbar.remove("command", this.toolbarCommand);
            this.toolbar.remove("hovercommand", function() {
            });
            this.toolbar.remove("hoverendcommand", function() {
            })
        },toolbarcmd: function(M, L) {
            if (M && typeof this["toolbarcmd_" + M] === "function") {
                this["toolbarcmd_" + M](L)
            }
        },toolbarhovercmd: function(M, L) {
            if (M && typeof this["toolbar_hovercmd_" + M] === "function") {
                this["toolbar_hovercmd_" + M](L)
            }
        },toolbarhoverendcmd: function(M, L) {
            if (M && typeof this["toolbar_hoverendcmd_" + M] === "function") {
                this["toolbar_hoverendcmd_" + M](L)
            }
        },toolbarcmd_smiley: function(L) {
            this.overlay.toggle("127px", "35px", "420px", "355px", "144px", this.config.rootPath + "smiley.html?id=" + this.id + "&bavl=false", L);
            return [false]
        },toolbarcmd_image: function(L) {
            this.overlay.toggle("5px", "35px", "540px", "240px", "13px", this.config.rootPath + "multipleupload.html?id=" + this.id, L);
            return [false]
        },toolbarcmd_music: function(L) {
            var N = this;
            var M = N.config.bavl;
            if (M >= 2) {
                N.overlay.toggle("60px", "35px", "500px", "400px", "126px", N.config.rootPath + "music.html?id=" + N.id, L)
            } else {
                N.overlay.toggle("60px", "35px", "320px", "65px", "126px", N.config.rootPath + "music_error.html?id=" + N.id, L)
            }
            return [false]
        },toolbarcmd_flash: function(L) {
            this.overlay.toggle("30px", "35px", "540px", "150px", "71px", this.config.rootPath + "flash.html?id=" + this.id, L);
            return [false]
        },toolbarcmd_picasso: function(L) {
            if (this.hasPicassoAuth()) {
                this.overlay.toggle("110px", "35px", "500px", "370px", "244px", "http://tieba.baidu.com/tb/editor/v2/picasso/picasso.html?id=" + this.id, L);
                F.Status.isPicassoOpen = true
            }
            return [false]
        },jumpTo_picasso: function() {
            if (this.hasPicassoAuth()) {
                this.overlay.open("110px", "35px", "500px", "370px", "244px", "http://tieba.baidu.com/tb/editor/v2/picasso/picasso.html?id=" + this.id);
                F.Status.isPicassoOpen = true
            }
            return [false]
        },toolbar_hovercmd_smiley: function(L) {
            return [false]
        },toolbar_hoverendcmd_smiley: function(L) {
            return [false]
        },toolbar_hovercmd_image: function(L) {
            return [false]
        },toolbar_hoverendcmd_image: function(L) {
            return [false]
        },toolbar_hovercmd_music: function(L) {
            return [false]
        },toolbar_hoverendcmd_music: function(L) {
            return [false]
        },toolbar_hovercmd_flash: function(L) {
            return [false]
        },toolbar_hoverendcmd_flash: function(L) {
            return [false]
        },toolbar_hovercmd_picasso: function(L) {
            if (!this.hasPicassoAuth()) {
                this.hoveroverlay.open("312px", "35px", "290px", "55px", "40px", "http://tieba.baidu.com/tb/editor/v2/picasso/picasso_noright.html?t=201111141108", L)
            }
            return [false]
        },toolbar_hoverendcmd_picasso: function(L) {
            if (this.config.picasso == undefined || this.config.picasso == false) {
                this.hoveroverlay.close()
            }
            return [false]
        },getMusiNum: function() {
            var L = this.getTagNum("embed", this.config.musicClassName);
            if (!this.ua.ie) {
                L += this.getTagNum("img", this.config.musicClassName)
            }
            return L
        },getFlashNum: function() {
            var L = this.getTagNum("embed", this.config.flashClassName);
            if (!this.ua.ie) {
                L += this.getTagNum("img", this.config.flashClassName)
            }
            return L
        },cmd_insertmusic: function(L) {
            var M = "";
            M = '<img class="BDE_Music" src="' + this.config.rootPath + 'music.png"';
            M += ' title="' + L + '"';
            M += ' width="400" height="95"';
            M += ' data-width="400" data-height="95">';
            this.execCommand("inserthtml", M);
            return [false]
        },cmd_insertflash: function(M) {
            var N = "";
            var L = 450, O = 500;
            if (M.toLowerCase().indexOf("baidu.com") > -1) {
                O = 480;
                L = 410
            } else {
                if (M.toLowerCase().indexOf("player.video.qiyi.com") > -1) {
                    O = 500;
                    L = 415
                } else {
                    O = 500;
                    L = 450
                }
            }
            N = '<img class="BDE_Flash" src="' + this.config.rootPath + 'flash.png"';
            N += ' title="' + M + '"';
            N += ' width="219" height="175"';
            N += ' data-width="' + O + '" data-height="' + L + '"/>';
            this.execCommand("inserthtml", N);
            this.execCommand("insertlinebreak");
            return [false]
        },img2embed: function(L) {
            return L.replace(/<img[^>]*class="?(?:BDE_Flash|BDE_Music)[^>]*>/gi, function(Q) {
                var N = Q.replace(/.* title\="?([^\s">]+).*/i, "$1").replace(/&amp;/gi, "&").replace(/(?:%61|%41|a)(?:%75|%55|u)(?:%74|%54|t)(?:%6f|%4f|o)(?:%70|%50|p)(?:%6c|%4c|l)(?:%61|%41|a)(?:%79|%59|y)(?:%3d|\=)(?:%74|%54|t)(?:%72|%52|r)(?:%55|%75|u)(?:%65|%45|e)/gi, "autoplay=false"), P = Q.replace(/.* data\-width\="?([^\s">]+).*/i, "$1"), M = Q.replace(/.* data\-height\="?([^\s">]+).*/i, "$1"), O = Q.replace(/.* class="?([^\s">]+).*/i, "$1");
                return '<embed allowfullscreen="true" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" scale="noborder"' + (N.toLowerCase().indexOf("http://player.ku6.com") == 0 ? ' flashvars="adss=0"' : " ") + 'src="' + N + '" class="' + O + '" width="' + P + '" height="' + M + '">'
            })
        },quoteContainer: null,quote: function(O, L, P) {
            O = parseInt(O);
            if (O > 1) {
                if (this.quoteContainer === null) {
                    this.quoteContainer = document.createElement("div");
                    this.quoteContainer.className = "editor-quote";
                    this.wrapper.insertBefore(this.quoteContainer, this.editAreaWrapper)
                }
                var N = document.getElementById("post_content_" + L).innerHTML.replace(/<img[^>]*>/gi, "[图片]").replace(/<embed[^>]*>/gi, "[视频]").replace(/<br[^>]*>/gi, " ").replace(/<a[^>]*>/gi, "").replace(/<\/a>/gi, "").subByte(270);
                this.quoteContainer.innerHTML = '<blockquote class="quote_change"><fieldset><legend ><a href="javascript:void(0);" onmousedown="return false;" style="font-weight:bold;color:#989898; position:absolute;right:5px; top:12px;text-decoration:none;font-size:15px;line-height:15px;font-weight:bold;font-family:微软雅黑" onclick="TED.Editor.getInstanceById(\'' + this.id + '\').unQuote();Stats.sendRequest(\'fr=tb0_forum&st_mod=pb&st_type=quote&st_value=delete\');" class="close" title="删除引用">╳</a>引用&nbsp;' + P + '&nbsp;(<a href="#' + L + '" style="color:#989898;">' + O + '楼</a>)</legend><p style="margin-left: 5px;padding: 0 5px;width: 505px;" class="quote_content">' + N + "</p></fieldset></blockquote>";
                this.quoteContainer.style.display = "block";
                this.fireEvent("quote", null, [L])
            } else {
                this.unQuote();
                Stats.sendRequest("fr=tb0_forum&st_mod=pb&st_type=quote&st_value=replyfirst")
            }
            var M = this;
            setTimeout(function() {
                M.focus()
            }, 300)
        },unQuote: function() {
            if (this.quoteContainer) {
                this.quoteContainer.style.display = "none"
            }
            this.fireEvent("unquote")
        }});
    function E(L, M) {
        E.superclass.call(this);
        this.hovertimer = null;
        this.hoverendtimer = null;
        this.container = L;
        this.enablepicasso = M;
        this.initialize()
    }
    I(E, C, {disabled: true,initialize: function() {
            this.holder = document.createElement("div");
            this.holder.className = "tb-editor-toolbar tb-editor-toolbar-disabled";
            this.holder.innerHTML = '<span class="image" data-cmd="image"></span><label></label><span class="flash" data-cmd="flash"></span><label></label><span class="music" data-cmd="music"></span><label></label><span class="smiley" data-cmd="smiley"></span><label></label><span class="picasso" data-cmd="picasso"></span>';
            this.container.appendChild(this.holder);
            var L = this;
            J.addEvent(this.holder, "click", function(N) {
                if (L.disabled) {
                    return
                }
                var M = N.target || N.srcElement;
                if (M.tagName.toLowerCase() === "span") {
                    L.fireEvent("command", null, [M.getAttribute("data-cmd"), M])
                }
            });
            J.addEvent(this.holder, "mouseover", function(N) {
                if (L.disabled) {
                    return
                }
                var M = N.target || N.srcElement;
                if (M.tagName.toLowerCase() === "span") {
                    if (L.hoverendtimer) {
                        clearTimeout(L.hoverendtimer)
                    }
                    L.hovertimer = setTimeout(function() {
                        L.fireEvent("hovercommand", null, [M.getAttribute("data-cmd"), M])
                    }, 800)
                }
            });
            J.addEvent(this.holder, "mouseout", function(N) {
                if (L.disabled) {
                    return
                }
                if (L.hovertimer) {
                    clearTimeout(L.hovertimer)
                }
                var M = N.target || N.srcElement;
                if (M.tagName.toLowerCase() == "span") {
                    L.hoverendtimer = setTimeout(function() {
                        L.fireEvent("hoverendcommand", null, [M.getAttribute("data-cmd"), M])
                    }, 400)
                }
            })
        },disable: function() {
            this.disabled = true;
            this.holder.className = "tb-editor-toolbar tb-editor-toolbar-disalbed"
        },enable: function() {
            this.disabled = false;
            this.holder.className = "tb-editor-toolbar";
            if (this.enablepicasso == undefined || this.enablepicasso == false) {
                $(".tb-editor-toolbar .picasso").css("background-position", "12px -293px").css("cursor", "pointer")
            }
        }});
    H(F, K)
})();


var FORUM_POST_PREFIX = "/f/commit/";
var FORUM_POST_URL = {threadAdd: FORUM_POST_PREFIX + "thread/add",postAdd: FORUM_POST_PREFIX + "post/add",threadVoteAdd: FORUM_POST_PREFIX + "vote/add ",forumCreate: FORUM_POST_PREFIX + "forum/create",threadDelete: FORUM_POST_PREFIX + "thread/delete",postDelete: FORUM_POST_PREFIX + "post/delete",goodAdd: FORUM_POST_PREFIX + "thread/good/add",goodCancel: FORUM_POST_PREFIX + "thread/good/cancel",threadTopAdd: FORUM_POST_PREFIX + "thread/top/add",threadTopCancel: FORUM_POST_PREFIX + "thread/top/cancel",get_tbs: "/dc/common/tbs"};
var FORUM_ERROR_INFO = {24: "登录错误，可能输入的用户名和口令不正确，请单击确定重试",102: "注册用户email非法",103: "注册用户个人信息非法",107: "用户名或自我介绍的文字中含有一些不恰当的词汇，请您重新提交注册信息",108: "用户名为空",266: "添加好友重复",205: "对不起，您没有此修改权限，请到您注册的系统中修改信息",305: "添加词语到达最大值",306: "添加词语到达最大值",309: "添加词语到达最大值",260: "讨论区已满三个吧主",261: "该用户已经是该吧的吧主",262: "该用户已经是三个贴吧的吧主",263: "用户指定好友名不存在",264: "用户好友数到达最大",265: "用户未登陆",267: "添加收藏夹到最大值",300: "达到系统最大过滤用户容量",301: "达到系统最大过滤IP容量",302: "管理员指定的关键字不存在贴吧",303: "管理员指定的用户名不存在",304: "管理员指定的IP有误",316: "操作失败！该IP地址为手机上网使用，无法直接封禁。",401: "根据forum_id 不能得到讨论名",402: "得到的贴吧名太长",870: "楼高人多，请勿推倒",871: "楼高慎推，冷静会儿吧",872: "精品来的不易，请勿擅自删除",874: "吧刊来得不易，请勿擅自删除"};
var Thread_add_result = {resultNo: 0,fid: "",tid: "",vid: "",sign: "",bdauditreason: 0,bdQueryWordEnc: "",autoMsg: "",is_login: 0,init: function(A) {
        if (Thread_add_result && A.data && typeof (A.data) == "object") {
            for (var B in A.data) {
                Thread_add_result[B] = A.data[B]
            }
        }
        Thread_add_result.resultNo = A.no
    },isNeedWaitForCheck: function() {
        var A = false;
        switch (this.resultNo) {
            case 9:
            case 20:
            case 23:
                A = true;
                break;
            default:
                break
        }
        return A
    },Action_FocusTitle: "focusTitle",Action_FocusContent: "focusContent",Action_ClearYZM: "clearYZM",Action_FocusUrl: "focusUrl",Action_GoToHead: "goToHead",Action_FlushAndGoToHead: "flushAndGoToHead",getActionType: function() {
        var A = "";
        switch (this.resultNo) {
            case 10:
            case 14:
            case 501:
            case 15:
            case 36:
            case 41:
            case 42:
            case 43:
            case 46:
                A = this.Action_FocusContent;
                break;
            case 11:
            case 20:
                A = this.Action_FocusTitle;
                break;
            case 17:
            case 0:
                A = this.Action_FlushAndGoToHead;
                break;
            case 22:
            case 9:
            case 23:
            case 119:
            case 44:
            case 100:
            case 703:
            case 704:
            case 705:
                A = this.Action_GoToHead;
                break;
            case 38:
            case 39:
            case 40:
                A = this.Action_ClearYZM;
                break;
            case 1120:
            case 1121:
                A = this.Action_FocusUrl;
                break;
            default:
                break
        }
        return A
    },getMessage: function() {
        var A = "", B = null;
        if (this.resultNo >= 901 && this.resultNo <= 950) {
            return Thread_add_result.autoMsg
        }
        if (B == null) {
            B = (PageData.forum) ? PageData.forum.id : null
        }
        if (B == null) {
            B = PageData.forum_id
        }
        if (B == null) {
            B = PageData.forumID
        }
        if (B == null) {
            B = good_add_data.fid ? good_add_data.fid : null
        }
        switch (this.resultNo) {
            case 10:
                A = "贴子内容包含太少的文字";
                break;
            case 11:
                A = "贴子标题和内容太长";
                break;
            case 12:
                if (B != null) {
                    A = "操作失败，您的账号因违规操作而被封禁&nbsp;&nbsp;<a href='/f/blockinfo?fid=" + B + '\' target="_blank">查看封禁信息</a>'
                } else {
                    A = "操作失败"
                }
                break;
            case 13:
                if (B != null) {
                    A = "操作失败，您的网络地址由于非法操作被封<br/><a href='/f/blockinfo?fid=" + B + '\' target="_blank">查看封禁信息</a>'
                } else {
                    A = "您的网络地址由于非法操作被封 "
                }
                break;
            case 14:
                A = "您发布的贴子已经存在";
                break;
            case 501:
            case 15:
                A = "请不要发表含有不适当内容的留言<br>请不要发表广告贴";
                break;
            case 16:
                A = "对不起，您所输入的贴吧不存在。由于系统升级维护，新建贴吧功能暂停，希望得到您的谅解！";
                break;
            case 19:
            case 200:
            case 201:
            case 202:
                A = "您的用户名或者密码填写有误，请确认后再发表";
                break;
            case 20:
                A = "您发表的贴子的标题或正文包含太少的文字，请修改后再发表";
                break;
            case 17:
                A = "本吧当前只能浏览，不能发贴！";
                break;
            case 18:
            case 21:
                A = "其他未知原因";
                break;
            case 22:
                A = "您发表的贴子已经成功提交，由于特殊原因我们需要核实该贴内容是否含有不良信息，我们会在10分钟内确认，请您耐心等待！";
                break;
            case 9:
                A = this.getCheckMessage(this.bdauditreason);
                break;
            case 33:
                if (Thread_add_result.is_login == 1) {
                    A = "您发贴太快了:) 请稍后再发"
                } else {
                    A = "您发贴速度太快了。为了减少恶意灌水和广告贴，系统对匿名发贴进行严格的控制，登录用户不受影响"
                }
                break;
            case 34:
                if (Thread_add_result.is_login == 1) {
                    A = "您说话太快了:) 请先停下来喝杯茶吧，或者可以去别的吧看看哦，一定会发现还有您感兴趣的话题"
                } else {
                    A = "您发贴速度太快了。为了减少恶意灌水和广告帖，系统对匿名发贴进行严格的控制，登录用户不受影响"
                }
                break;
            case 35:
                if (Thread_add_result.is_login == 1) {
                    A = "您。。。！"
                } else {
                    A = "您发贴速度太快了。为了减少恶意灌水和广告贴，系统对匿名发贴进行严格的控制，登录用户不受影响"
                }
                break;
            case 36:
                A = "请不要发广告贴！";
                break;
            case 37:
                A = "您已尝试提交多次了，请返回后刷新页面，方可重新发贴";
                break;
            case 38:
                A = "验证码超时，请重新输入";
                break;
            case 39:
                A = "由于您多次输错验证码，请您返回后刷新页面，方可重新发贴";
                break;
            case 40:
                A = "验证码输入错误，请您返回后重新输入";
                break;
            case 41:
                A = "您的贴子可能包含不合适的内容，请您确定后再提交";
                break;
            case 42:
                A = "您的发贴行为被系统认为有发广告嫌疑，请您稍后再发";
                break;
            case 43:
                A = "您的发贴行为或贴子内容有广告或不合适的特征，请您确定后再发送";
                break;
            case 23:
                A = "您的贴子已经成功提交，但需要系统审核通过后才能建立贴吧";
                break;
            case 119:
                A = "对不起，本主题的回复数已经达到上限，感谢您的参与，欢迎您浏览本吧的其它主题";
                break;
            case 1120:
                A = "抱歉，您输入的图片、视频链接地址错误，您可以点击<a href='http://www.baidu.com/search/post_img.html' target='_blank'>查看相关帮助</a>或返回修改";
                break;
            case 1121:
                A = "抱歉，视频服务升级中，您暂时无法发表带有视频的贴子，给您带来的不便请原谅";
                break;
            case 44:
                A = "对不起，本吧暂时限制部分用户发表主题贴子，您可以浏览或回复本吧其它内容，给您带来不便希望得到您的谅解。";
                break;
            case 100:
                A = "对不起，本吧暂时限制部分用户使用完整的贴吧功能，您可以浏览本吧其它内容，给您带来不便希望得到您的谅解。";
                break;
            case 701:
                A = "为了减少恶意灌水和广告帖，本吧不允许未登录用户发贴，登录用户不受影响，给您带来的不便深表歉意";
                break;
            case 702:
                A = "为了减少恶意灌水和广告帖，本吧限制部分用户发贴，给您带来的不便深表歉意";
                break;
            case 703:
                A = "为了减少恶意灌水和广告帖，本吧被设置为仅本吧会员才能发贴，给您带来的不便深表歉意。<a href='/f?kw=" + this.bdQueryWordEnc + "#1' target=_blank>点此申请加入</a>本吧会员";
                break;
            case 704:
                A = "为了减少恶意灌水和广告帖，本吧被设置为仅本吧管理团队才能发贴，给您带来的不便深表歉意";
                break;
            case 705:
                A = "本吧当前只能浏览，不能发贴！";
                break;
            case 706:
                A = "抱歉，本贴暂时无法回复。";
                break;
            case 45:
                A = "抱歉，您提交的贴吧名称含特殊字符，目前无法创建，推荐您使用汉字、字母或数字作为贴吧名称";
                break;
            case 46:
                A = "抱歉，您的贴子过长，无法正常提交。建议您精简或分段后重新提交，谢谢!";
                break;
            case 800:
                break;
            case 801:
                break;
            case 802:
                break;
            case 803:
                break;
            case 804:
                break;
            case 805:
                break;
            case 806:
                break;
            case 807:
                break;
            case 808:
                break;
            case 809:
                break;
            case 814:
                break;
            case 815:
                A = "抱歉，您已退出登录或未购买音乐道具，请刷新页面重试";
                break;
            case 900:
                A = "为抵御挖坟危害，本吧吧主已放出贴吧神兽--超级静止蛙，本贴暂时无法回复。";
                break;
            default:
                A = "未知错误";
                break
        }
        return A
    },getCheckMessage: function(B) {
        var A = "";
        switch (B) {
            case -61:
                A = "您的贴子已经成功提交，但为了保证贴子质量，本吧所发的贴子待系统审核通过后才能显示，请您耐心等待";
                break;
            case -62:
                A = "您的贴子已经成功提交，但为了保证贴子质量，本吧贴图的贴子需要审核通过后才能显示，请您耐心等待";
                break;
            case -74:
            case -75:
            case -60:
                A = "您发表的贴子已经成功提交，但系统需要核实该贴子内容是否含有不良信息，贴子在审核通过后才能显示，请您耐心等待";
                break;
            case -70:
                A = "您的贴子已经成功提交，但为了控制广告贴，需要通过审核后才能发布。登陆署名发贴不受此限制。";
                break;
            case -71:
                A = "您发表的帖子太长了。为了防止灌水，需系统审核后才能显示，请稍后查看";
                break;
            default:
                A = "您发表的贴子已经成功提交，但系统需要核实该贴子内容是否含有不良信息，贴子在审核通过后才能显示，请您耐心等待";
                break
        }
        return A
    }};
var CaptchaNew = function(C) {
    this._option = C;
    var B = new Date().valueOf();
    this._dom = {c_input_id: "captcha" + B,c_tip: "tip" + B,c_content: "c_content" + B,c_error: "c_error" + B,img_ele: "img" + B,c_img_con: "c_i_c" + B,a_img: "a" + B,listen_vcode: "lv" + B,audio_img: "ai" + B,captcha_audio: "ca" + B};
    var A = this;
    A.initHtml();
    $("#" + this._dom.c_input_id).blur(function() {
        A.reset()
    });
    $("#" + this._dom.c_input_id).focus(function() {
        A.init()
    })
};
CaptchaNew.prototype.initHtml = function() {
    var A = this._option;
    var B = '<input  id="' + this._dom.c_input_id + '" style="ime-mode:disabled " autocomplete="off" size="10" maxlength="10">';
    B += '<span id="' + this._dom.c_tip + '">&nbsp;请点击后输入验证码</span>';
    B += '<div id="' + this._dom.c_content + '" style="display:none;"></div><div id="' + this._dom.c_error + '" class="postErrorVCode"></div>';
    $("#" + this._option._container_ele).html(B)
};
CaptchaNew.prototype.changeContent = function(B) {
    var A = this._option;
    if (B == "loginUser") {
        if (Captcha_requirement.answer.showShenshou == 1 && Captcha_requirement.answer.open_by_spam != 1) {
            $("#" + this._dom.c_tip).html("为抵御爆吧挖坟，吧主设置本吧" + Captcha_requirement.answer.shenshou_lv + "级以下用户暂时需要输入中文验证码")
        } else {
            $("#" + this._dom.c_tip).html("&nbsp;请点击后输入验证码")
        }
    } else {
        if (Captcha_requirement.answer.showShenshou == 1 && Captcha_requirement.answer.open_by_spam != 1) {
            $("#" + this._dom.c_tip).html("为抵御爆吧挖坟，吧主设置本吧" + Captcha_requirement.answer.shenshou_lv + "级以下用户暂时需要输入中文验证码")
        } else {
            $("#" + this._dom.c_tip).html(" 请点击后输入验证码，匿名发贴需要输入验证码")
        }
    }
};
CaptchaNew.prototype.getAudio = function() {
    this._option._need_update = false;
    var C = this._dom;
    document.getElementById(C.audio_img).style.display = "";
    var A = document.getElementById(C.captcha_audio);
    var B = this._option._audio_url + this._option.sign_str + "&t=" + Math.random();
    if (!document.all) {
        A.innerHTML = '<embed src="' + B + '" name="MediaPlayer" type="video/x-ms-wmv" autostart="1" showcontrols="1" allowscan="1" playcount="1" enablecontextmenu="0" height="0" width="0"></object>'
    } else {
        A.innerHTML = '<object height=0 width=0 classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6><param name="AutoStart" value="1"><param NAME="url" value="' + B + '"><param name="PlayCount" value="1">'
    }
    document.getElementById(C.c_input_id).focus()
};
CaptchaNew.prototype._getData = function() {
    Captcha_requirement.antiProcess();
    var B = Captcha_requirement.getVcodeUrl() + "&t=" + Math.random();
    var A = this;
    $.ajax({url: B,dataType: "json",success: function(D) {
            var C = D.data;
            A._option.sign_str = C.vcodestr
        },async: false})
};
CaptchaNew.prototype._validCaptcha = function() {
    var B = document.getElementById(this._dom.c_input_id);
    var C = document.getElementById(this._dom.c_error);
    var A = B.value;
    Captcha_requirement.antiProcess();
    if (Captcha_requirement.need_captcha == 1) {
        if (A == "" || A == null) {
            C.innerHTML = "验证码不能为空，请输入验证码";
            C.style.display = "block";
            B.focus();
            return false
        }
    }
    return true
};
CaptchaNew.prototype.getInputValue = function() {
    return $("#" + this._dom.c_input_id).val()
};
CaptchaNew.prototype.changeYImg = function(A) {
    var B = A;
    B.src = "http://static.tieba.baidu.com/tb/img/errorYimg.jpg"
};
CaptchaNew.prototype.init = function() {
    if (!this._option._need_update) {
        return
    }
    this._option._need_update = false;
    this._getData();
    var C = document.getElementById(this._dom.img_ele);
    var A = this._option._img_url + this._option.sign_str + "&t=" + Math.random();
    if (!C) {
        var B = document.getElementById(this._dom.c_img_con);
        B.innerHTML = '<img  id="' + this._dom.img_ele + '" src="' + A + '">'
    } else {
        C.src = A
    }
    $("#" + this._dom.c_content).show()
};
CaptchaNew.prototype.reload = function() {
    this.reset();
    this.init()
};
CaptchaNew.prototype.updateImage = function() {
    this._option._need_update = false;
    var B = document.getElementById(this._dom.c_input_id);
    B.value = "";
    B.focus();
    var A = this._option._img_url + this._option.sign_str + "&t=" + Math.random();
    var C = document.getElementById(this._dom.img_ele);
    C.src = A
};
CaptchaNew.prototype.show = function() {
    $("#" + this._option._container_ele).show();
    var D = document.getElementById(this._dom.c_content);
    if (D.innerHTML != "") {
        return
    }
    var F = this._dom;
    var C = '<table style="width:auto;"><tr><td id="' + F.c_img_con + '"></td><td valign="bottom">&nbsp;&nbsp;<a style="cursor:pointer;" href="" id="' + F.a_img + '" >看不清?</a>&nbsp;<a style="cursor:pointer;" href="" id="' + F.listen_vcode + '"  >收听验证码</a></td><td valign="bottom"><img id="' + F.audio_img + '" src="http://tieba.baidu.com/tb/img/audio.gif" style="display:none;vertical-align:top;margin-bottom:1px;"><span id="' + F.captcha_audio + '"></span></td></tr></table>';
    D.innerHTML = C;
    var A = this;
    $("#" + this._dom.a_img).click(function() {
        A.reload();
        return false
    });
    $("#" + F.listen_vcode).click(function() {
        A.getAudio();
        return false
    });
    if (Captcha_requirement.answer.showShenshou == 1 && document.getElementById(F.c_tip)) {
        if (Captcha_requirement.answer.open_by_spam == 1) {
            document.getElementById(F.c_tip).innerHTML = "&nbsp;请点击后输入验证码"
        } else {
            document.getElementById(F.c_tip).innerHTML = "&nbsp;为抵御爆吧挖坟，吧主设置本吧" + Captcha_requirement.answer.shenshou_lv + "级以下用户暂时需要输入中文验证码"
        }
        var B = document.getElementById(F.c_input_id);
        var E = document.getElementById(F.listen_vcode);
        if (B) {
            B.style.imeMode = "active"
        }
        if (E) {
            E.style.display = "none"
        }
    }
};
CaptchaNew.prototype.hide = function() {
    $("#" + this._option._container_ele).hide();
    $("#" + this._dom.c_content).show();
    $("#" + this._dom.c_input_id).val("");
    $("#" + this._dom.c_error).html("");
    $("#" + this._dom.c_error).hide()
};
CaptchaNew.prototype.reset = function() {
    this._option._need_update = true
};
var SignNameApply = {fillPanelId: "signNamePanel",getUrl: "/f/user/sign_list?t=" + new Date().getTime().toString(36),isFirst: true,isUsed: 0,data: {},template: function() {
        var B = '<div id="signNameWrapper">';
        B += '<input type="checkbox" id="useSignName" name="useSignName"><label for="useSignName">使用签名档</label>&nbsp;';
        B += '<span id="signNameShow"' + ((this.isUsed == 0) ? 'style="display:none;"' : "") + ">";
        if (this.data.signs.length > 0) {
            B += '<select id="sign_id" name="sign_id">';
            for (var D = 0, C = this.data.signs.length; D < C; D++) {
                var A = this.data.signs[D];
                B += '<option value="' + A.id + '"' + ((A.id == this.data.used_id) ? "selected=selected" : "") + ">" + A.name + "</option>"
            }
            B += "</select>";
            B += '&nbsp;<a style="color:#0449BE" target="_blank" href="/i/sys/jump?type=signsetting">查看全部</a>'
        } else {
            B += '（您目前没有可使用的签名档，&nbsp;<a style="color:#0449BE" target="_blank" href="/i/sys/jump?type=signsetting">查看全部</a>)'
        }
        B += "</span>";
        B += "</div>";
        return B
    },active: function() {
        if (this.isFirst) {
            this.isFirst = false;
            var A = this.getUrl;
            this.postProcess(A, null, this.build)
        }
    },postProcess: function(url, data, callback) {
        var self = this;
        if (data == null) {
            $.get(url, function(xhr) {
                var json = eval("(" + xhr + ")");
                if (json.no == 0) {
                    if (typeof callback == "function") {
                        callback(self, json)
                    }
                }
            })
        } else {
            $.post(url, SignNameApply._convertToQueryString(data), function(xhr) {
                var json = eval("(" + xhr + ")");
                if (json.no == 0) {
                    if (typeof callback == "function") {
                        callback(self, json)
                    }
                }
            })
        }
    },_convertToQueryString: function(B) {
        var C = [];
        for (var A in B) {
            C.push(encodeURIComponent(A) + "=" + encodeURIComponent(B[A]))
        }
        return C.join("&")
    },build: function(A, B) {
        A.data = B.data;
        A.isUsed = B.data.need;
        A.fillToPage()
    },fillToPage: function() {
        $("#" + this.fillPanelId).html(this.template());
        this.initPage()
    },showList: function() {
        if (this.isUsed == 1) {
            $("#signNameShow").css("display", "")
        } else {
            $("#signNameShow").css("display", "none")
        }
    },initPage: function() {
        if (this.isUsed == 1) {
            $("#useSignName").attr("checked", true)
        } else {
            $("#useSignName").attr("checked", false)
        }
        this.showList();
        this.handlerEven()
    },setisUsed: function(A) {
        if (A) {
            this.isUsed = 1
        } else {
            this.isUsed = 0
        }
        this.showList();
        this.postProcess("/f/user/cm/sign_setneed", {need: this.isUsed,tbs: PageData.tbs}, null)
    },handlerEven: function() {
        var A = this;
        $("#useSignName").click(function() {
            A.setisUsed(this.checked)
        })
    }};
var MemTip = (function() {
    var D = null;
    function H(I) {
        if (I) {
            D = I;
            var K = A(I);
            var J = G();
            J.style.left = (K[0] - 15) + "px";
            J.style.top = (K[1] - 125) + "px";
            J.style.display = ""
        }
    }
    function B() {
        var I = G();
        I.style.display = "none"
    }
    function F(M, K, J) {
        var I = '<div id="memTipPanel" style="float:left;width:208px; font-size:12px; line-height: 22px; display:inline; margin-left: 10px;">';
        if (M) {
            I += '<div id="memTipTitle" style="font-weight:bold; margin-top: 10px;">' + M + "</div>"
        }
        if (K) {
            I += K
        }
        I += '</div><div  id="memTipClosePanel" style="float:right;padding: 10px 10px 0px 0px;"><a id="memTipMemTipClose" href="javascript:void(0)" style="display:block; width: 15px;height: 15px;" onclick="MemTip.hide()"></a></div><div style="clear:both"></div>';
        var L = G();
        if (L) {
            if (J) {
                L.style.background = J
            }
            L.innerHTML = I
        }
    }
    function A(I) {
        var J = curtop = 0;
        if (I.offsetParent) {
            J = I.offsetLeft;
            curtop = I.offsetTop;
            while (I = I.offsetParent) {
                J += I.offsetLeft;
                curtop += I.offsetTop
            }
        }
        return [J, curtop]
    }
    function G() {
        var I = document.getElementById("memTipDiv");
        if (!I) {
            I = document.createElement("div");
            I.id = "memTipDiv";
            I.style.width = "245px";
            I.style.height = "120px";
            I.style.position = "absolute";
            I.style.zIndex = "2000";
            I.style.display = "none";
            E(document, "click", C);
            document.body.appendChild(I)
        }
        return I
    }
    function C(K) {
        var J = K.target || event.srcElement;
        if (J != D) {
            var L = ["memTipDiv", "memTipPanel", "memTipTitle", "memTipClosePanel"];
            var I = 0;
            for (I = 0; I < L.length; I++) {
                if (document.getElementById(L[I]) == J) {
                    break
                }
            }
            if (I == L.length) {
                MemTip.hide()
            }
        }
    }
    function E(K, I, J) {
        if (window.addEventListener) {
            K.addEventListener(I, J, false)
        } else {
            if (window.attachEvent) {
                K.attachEvent("on" + I, J)
            }
        }
    }
    return {buildHTML: function(K, J, I) {
            F(K, J, I)
        },show: function(I) {
            H(I)
        },hide: function() {
            B()
        }}
})();
function showMemTip(C) {
    var E = "会员发贴：";
    var D = PageData.forum ? PageData.forum.name_url : PageData.forum_name_u;
    var B = "只允许<a target='_blank' href='/f/like/level?kw=" + D + "'>4级头衔</a>及以上用户在登录状态下发贴。请检查一下您是否已经登录，以及是否达到相应会员等级。";
    var A = "url('http://static.tieba.baidu.com/tb/img/infotip.gif') no-repeat";
    MemTip.buildHTML(E, B, A);
    MemTip.show(C)
}
var Captcha_requirement = {_is_anomy: 0,_vcodeUrl: "",answer: {antiNeedVerify: null,antiNeedVerifyA: null},post_type: "thread",forum_name_url: "",forum_id: 0,need_captcha: 0,_ifHasKnowAnti: function(A) {
        switch (A) {
            case 1:
                return !(this.answer.antiNeedVerifyA == null);
                break;
            case 0:
            default:
                return !(this.answer.antiNeedVerify == null)
        }
    },setVcodeUrl: function(A) {
        this._vcodeUrl = A
    },getVcodeUrl: function() {
        return this._vcodeUrl
    },_getAntiAnswer: function(C) {
        var B = "/f/user/json_needvcode?rs1=" + (this._is_anomy == 1 ? "1" : "0") + "&rs10=" + (this.post_type == "thread" ? "1" : "0") + "&lm=" + this.forum_id + "&word=" + this.forum_name_url + "&t=" + Math.random();
        if (this.tid) {
            B += "&tid=" + this.tid
        }
        var A = this;
        $.ajax({url: B,dataType: "json",async: true,success: function(D) {
                A.handleAnswer(D.data);
                setTimeout(function() {
                    if (!PageData.tbs_loaded) {
                        TbUtil.requestTbs()
                    }
                }, 30);
                C()
            }})
    },handleAnswer: function(A) {
        if (this._is_anomy == 1) {
            this.answer.antiNeedVerifyA = A.need
        } else {
            this.answer.antiNeedVerify = A.need
        }
        this.answer.showShenshou = A.open_shenshou;
        if (A.open_shenshou == 1) {
            this.answer.shenshou_lv = A.shenshou_lv;
            this.answer.open_by_spam = A.open_by_spam
        }
        if (this.tid) {
            A.vcodeUrl += "&tid=" + this.tid
        }
        this.setVcodeUrl(A.vcodeUrl)
    },setData: function(A, B) {
        Captcha_requirement[A] = B
    },antiProcess: function(D) {
        var B = this;
        var C = "";
        var A = function() {
            if (B._is_anomy) {
                C = B.answer.antiNeedVerifyA
            } else {
                C = B.answer.antiNeedVerify
            }
            if (C == "1") {
                PageData.need_captcha = 1;
                B.need_captcha = 1
            } else {
                PageData.need_captcha = 0;
                B.need_captcha = 0
            }
            if (D) {
                D()
            }
        };
        if (!this._ifHasKnowAnti(this._is_anomy)) {
            this._getAntiAnswer(A)
        } else {
            A()
        }
    },init: function(B, C, A) {
        this.forum_name_url = B;
        this.forum_id = C;
        if (A == "reply") {
            this.post_type = "reply";
            if (PageData.thread) {
                this.tid = PageData.thread.id
            }
        }
    }};
var RichPostor = function(option) {
    var eidtor = $("#" + option.editorDom);
    this._data_postor = eval("(" + eidtor.attr("data-postor") + ")");
    this._data_editor = eval("(" + eidtor.attr("data-editor") + ")");
    var data_temp = this._data_editor;
    this._option = option;
    this._isPosting = false;
    this._check_post_thread = null;
    this._maxMusicNum = 10;
    if (data_temp.is_readonly == 1 || data_temp.forbid_flag == 6) {
    } else {
        var tpl = $("#" + option.tpl_id)[0].innerHTML + "";
        this._generi_dom_id(option);
        var userInfo = option.userInfo;
        tpl = fe_format(tpl, this._dom_id);
        eidtor[0].innerHTML = tpl;
        var domId = this._dom_id;
        var e_option = {container: domId.editorInput,uid: userInfo.user["id"],flashNumLimit: option.media_conf["flashLimite"],flashWhiteList: option.media_conf["flashWhiteList"],height: "191px",width: "603px",forum_name: this._data_postor.kw,user_name: userInfo.user_name,picasso: option.picasso,bavl: option.bavl};
        var c_option = {_container_parent: domId.captcha_container,_container_ele: domId.captcha_div,_img_url: "/cgi-bin/genimg?",_audio_url: "/cgi-bin/genaudio?",_need_update: true,sign_str: "",has_grade: data_temp.has_grade,u_forum_name: data_temp.u_forum_name};
        if (data_temp.can_post != 1) {
            e_option.autoEnable = false
        } else {
            if (option.no_un == true && data_temp.forbid_flag > 0) {
                e_option.autoEnable = false
            }
        }
        this._editor = new TED.Editor(e_option);
        this._captcha = new CaptchaNew(c_option);
        if (data_temp.is_login) {
            if (option.no_un == false || typeof option.no_un == "undefined") {
                $("#" + domId.post_user).show()
            } else {
                $("#" + domId.post_user).html('<td style="padding-top:5px" valign="top"></td> <td style="padding-top:5px">没有用户名，只能匿名发贴&nbsp;&nbsp;<a href="javascript:void(0)" onclick="TbCom.process(\'User\',\'buildUnameFrame\')">马上填写用户名</a></td>');
                $("#" + domId.post_user).show()
            }
            if (data_temp.can_post == 1) {
                if (option.no_un == false || typeof option.no_un == "undefined") {
                    this._eventInit(option);
                    $("#" + domId.add_post_submit).attr("disabled", false);
                    $("#" + domId.add_post_submit).className = "subbtn_bg";
                    $("#" + domId.post_login).attr("checked", true);
                    $("#" + domId.post_login).attr("disabled", false);
                    if (data_temp.forbid_flag == 0) {
                        $("#" + domId.post_anonym_con).show()
                    } else {
                        $("#" + domId.post_anonym_con).hide()
                    }
                } else {
                    if (data_temp.forbid_flag == 0) {
                        this._eventInit(option);
                        $("#" + domId.add_post_submit).attr("disabled", false);
                        $("#" + domId.add_post_submit).className = "subbtn_bg";
                        Captcha_requirement.setData("_is_anomy", 1)
                    } else {
                        $("#" + domId.post_login).attr("disabled", true);
                        $("#" + domId.add_post_submit).attr("disabled", true);
                        $("#" + domId.add_post_submit).className = "subbtn_bg_banned";
                        $("#editor").find("td").css("color", "#CCCCCC")
                    }
                }
                this._event = {onSuccess: [],onFail: [],onBefore: []}
            } else {
                $("#" + domId.post_login).attr("disabled", true);
                $("#" + domId.add_post_submit).attr("disabled", true);
                $("#" + domId.add_post_submit).className = "subbtn_bg_banned";
                $("#editor").find("td").css("color", "#CCCCCC")
            }
        } else {
            $("#editor").find("td").css("color", "#CCCCCC")
        }
        this._init();
        this._showBannedTip(data_temp.forbid_flag, data_temp.is_login, data_temp.can_post)
    }
};
RichPostor.prototype.jumpToTry = function(D) {
    var C = this._data_editor;
    if (C.is_login && C.can_post == 1) {
        var B = this._editor.toolbar;
        var A = this._editor.overlay;
        if (D == 6) {
            this._editor.jumpTo_picasso()
        } else {
            A.open("127px", "35px", "420px", "355px", "123px", this._editor.config.rootPath + "smiley.html?id=" + this._editor.id + "&bavl=true")
        }
    }
};
RichPostor.prototype.create_tip = function() {
    var A = this._editor;
    A.smileyTip = document.createElement("div");
    A.smileyTip.className = "smiley_tip";
    A.smileyTip.innerHTML = "<div class='tip_panel'><span style='font-size:12px;line-height:35px;margin-left:13px;'>5款情人节专属表情限时供应！表白？送花？求过节？快来说出你的心声~</span><span class='tip_closed'></span></div><span class='tip_arrows'></span>";
    $("#" + this._dom_id.editorInput).children(".tb-editor-wrapper").append(A.smileyTip);
    $(".tip_closed").click(function() {
        $(".smiley_tip").hide();
        $.cookie("smiley_tip", "closed", {expires: 7})
    })
};
RichPostor.prototype.show_tip = function() {
    var D = new Date();
    var C = new Date();
    C.setFullYear(2012, 1, 15);
    C.setMinutes(0, 0, 0);
    var A = D.valueOf();
    var B = C.valueOf();
    if (A > B) {
    } else {
        var E = $.cookie("smiley_tip");
        if (!E) {
            this.create_tip()
        }
    }
};
RichPostor.prototype._generi_dom_id = function(A) {
    var B = new Date().valueOf();
    this._dom_id = {post: "pt" + B,editor_banned_tip: "ebt" + B,editorInput: "eInput" + B,coError: "co" + B,post_login: "pl" + B,post_user: "pu" + B,post_anonym_con: "pac" + B,post_anonym: "pa" + B,msg_cannot_anonym: "mca" + B,signPanel: "sp" + B,captcha_container: "cc" + B,captcha_div: "cd" + B,add_post_submit: "aps" + B,uname: A.userInfo["user_name"],title_tr: "tt" + B,title_div: "td" + B,reply_h: "rh" + B,tiError: "tE" + B};
    if (A.title) {
        this._dom_id.title = A.title
    } else {
        this._dom_id.title = "title"
    }
};
RichPostor.prototype._eventInit = function(C) {
    var B = this;
    var D = this._data_editor;
    var F = this._dom_id;
    var A = C.userInfo;
    if (this._editor.isMobile) {
    } else {
        try {
            this._editor.addPlugin("autoheight", new TED.EditorPlugins.AutoHeightPlugin());
            this._editor.addPlugin("draft", new TED.EditorPlugins.SaveDraft(A.user["id"], this._data_postor.fid, this._data_postor.tid, C.isPb));
            this._editor.addPlugin("filtehtml", new TED.EditorPlugins.FilteHtmlPlugin(true));
            if (this._option.open_idisk) {
                this._editor.addPlugin("idisk", new TED.EditorPlugins.IdiskPlugin(this._option.power_idisk, this._data_postor.fid, this._option.upload_max_length, this._option.upload_max_size));
                this._editor.on("idisk_upload_complete", function(G) {
                    var H = this.getPostorDataObj("files");
                    H = H || [];
                    H.push({name: G.name,size: G.size,bucket: G.bucket,md5: G.md5,fileid: G.fileid});
                    this.setPostorDataObj("files", H)
                }, this);
                this._editor.on("idisk_remove_file", function(J) {
                    var I = this.getPostorDataObj("files");
                    if (!I) {
                        return
                    }
                    for (var H = 0, G = I.length; H < G; H++) {
                        if (I[H]["bucket"] === J) {
                            I.splice(H, 1);
                            if (I.length === 0) {
                                this.setPostorData("files", undefined)
                            } else {
                                this.setPostorDataObj("files", I)
                            }
                            return
                        }
                    }
                }, this)
            }
            MousePwd.start(["tb-editor-wrapper"])
        } catch (E) {
        }
    }
    this._editor.on("quote", function(G) {
        this.setPostorData("quote_id", G)
    }, this);
    this._editor.on("unquote", function() {
        this.setPostorData("quote_id", 0)
    }, this);
    this._editor.on("focus", function() {
        setTimeout(function() {
            B._initCaptchaAndSign(B)
        }, 0)
    });
    this._editor.on("click", function() {
        setTimeout(function() {
            B._initCaptchaAndSign(B)
        }, 0)
    });
    if (C.no_un == false || typeof C.no_un == "undefined") {
        $("#" + F.post_login).click(function() {
            Captcha_requirement.setData("_is_anomy", 0);
            B._initCaptchaAndSign(B);
            B._captcha.changeContent("loginUser")
        });
        $("#" + F.post_anonym).click(function() {
            Captcha_requirement.setData("_is_anomy", 1);
            B._initCaptchaAndSign(B);
            B._captcha.changeContent("anonym")
        })
    }
    $("#" + F.add_post_submit).mouseover(function() {
        $(this).attr("class", "subbtn_bg_hover")
    });
    $("#" + F.add_post_submit).mouseout(function() {
        $(this).attr("class", "subbtn_bg")
    });
    $("#" + F.add_post_submit).mousedown(function() {
        $(this).attr("class", "subbtn_bg_active")
    });
    $("#" + F.post).submit(function() {
        B._submit();
        return false
    });
    $("#" + F.post).keydown(function(G) {
        var H = G || window.event;
        if (H.ctrlKey && H.keyCode == 13) {
            if (H.preventDefault) {
                H.preventDefault()
            } else {
                H.returnValue = false
            }
            B._submit()
        }
    })
};
RichPostor.prototype._init = function() {
    var A = this;
    var E = this._dom_id;
    var F = this._option;
    if (this._option.title) {
        var D = this._data_editor.is_notitle;
        $("#" + E.title_tr).show();
        $("#" + E.reply_h).hide();
        var C = this._data_editor;
        var B = document.getElementById(this._option.title);
        if (B) {
            if (D) {
                $("#" + F.title).val(A._option.newTitieField_tip).css("color", "#999999");
                if (C.can_post == 1 && C.is_login) {
                    if (F.no_un == false || typeof F.no_un == "undefined" || (F.no_un == true && C.forbid_flag == 0)) {
                        $("#" + F.title).bind("focus", function() {
                            if ($(this).val().trim() == A._option.newTitieField_tip) {
                                $(this).val("")
                            }
                            A.setPostorData("tfrom", 3);
                            A._initCaptchaAndSign(A)
                        }).bind("blur", function() {
                            if ($(this).val().trim() == "") {
                                $(this).val(A._option.newTitieField_tip).css("color", "#999999");
                                A.setPostorData("tfrom", 2)
                            }
                        })
                    }
                }
            } else {
                if (C.can_post == 1 && C.is_login) {
                    if (F.no_un == false || typeof F.no_un == "undefined" || (F.no_un == true && C.forbid_flag == 0)) {
                        $("#" + F.title).focus(function() {
                            A._initCaptchaAndSign(A)
                        })
                    }
                }
            }
            if (C.can_post == 1 && C.is_login) {
                if (F.no_un == false || typeof F.no_un == "undefined" || (F.no_un == true && C.forbid_flag == 0)) {
                    $("#" + this._option.title).keydown(function(G) {
                        var H = G || window.event;
                        return A._limitTitle(H, this)
                    });
                    $("#" + this._option.title).bind("input", function() {
                        var G = this.value;
                        if (G.getByteLength() == 60) {
                            return false
                        }
                        if (G.getByteLength() > 60) {
                            this.value = G.subByte(60)
                        }
                        return true
                    });
                    $("#" + this._option.title).bind("propertychange", function() {
                        var G = this.value;
                        if (G.getByteLength() == 60) {
                            return false
                        }
                        if (G.getByteLength() > 60) {
                            this.value = G.subByte(60)
                        }
                        return true
                    })
                }
            }
        }
    } else {
    }
};
RichPostor.prototype._limitTitle = function(G, E) {
    var B = [8, 9, 16, 17, 18, 20, 13, 27, 37, 38, 39, 40, 33, 34, 35, 36, 45, 46, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 144, 145];
    var F = G;
    var A = -1;
    for (var D = 0; D < B.length; D++) {
        if (B[D] == F.keyCode) {
            A = D;
            break
        }
    }
    if (A >= 0) {
        return true
    }
    var C = E.value.toString();
    if (F.ctrlKey || F.altKey) {
        return true
    }
    if (C.getByteLength() == 60) {
        return false
    }
    if (C.getByteLength() > 60) {
        E.value = C.subByte(60)
    }
    return true
};
RichPostor.prototype.bindEvent = function(B, A) {
    if (this._event[B]) {
        this._event[B].push(A)
    }
};
RichPostor.prototype.reply = function(A, B, E) {
    var D = this._data_editor;
    var C = this._option;
    if (D.can_post != 1) {
        return false
    } else {
        if (C.no_un == true && D.forbid_flag > 0) {
            return false
        }
    }
    this._editor.quote(A, B, E);
    if (PageData.is_last_page && PageData.is_lzl == 0) {
        Stats.sendRequest("fr=tb0_forum&st_mod=pb&st_type=quote&st_value=rp_reply")
    }
};
RichPostor.prototype._tip = [[], ["", "本吧目前仅限登录用户发贴，不能使用匿名发贴功能", ], ["抱歉，本吧目前仅限吧务团队及注册满一定时间的老用户发贴", "本吧目前仅限吧务团队及注册满一定时间的老用户发贴，不能使用匿名发贴功能"], ["抱歉，根据相关法律法规和政策，本吧目前仅限会员发贴", "本吧目前仅限会员发贴，不能使用匿名发贴功能"], ["抱歉，本吧目前仅限吧务团队发贴", "本吧目前仅限吧务团队发贴，不能使用匿名发贴功能"], ["抱歉，根据相关法律法规和政策，本吧目前只能浏览，不能发贴", "抱歉，根据相关法律法规和政策，本吧目前只能浏览，不能发贴"]];
RichPostor.prototype._showBannedTip = function(H, E, A) {
    var F = null;
    var C = this._dom_id;
    var D = this._option;
    var B = "";
    if (A == 1) {
        if (D.no_un == false || typeof D.no_un == "undefined") {
            F = document.getElementById(C.editor_banned_tip);
            if (F != null) {
                F.style.display = "none"
            }
            if (H > 0) {
                F = document.getElementById(C.msg_cannot_anonym);
                B = "（" + this._tip[H][1] + "）"
            }
        } else {
            if (E) {
                F = document.getElementById(C.editor_banned_tip);
                if (H > 0) {
                    B = '<div class="editor_banned_tip_info">本吧不允许匿名发贴,请先&nbsp;&nbsp;<a href="javascript:void(0)" onclick="TbCom.process(\'User\',\'buildUnameFrame\')">填写用户名</a></div>';
                    this.disable()
                } else {
                    if (F != null) {
                        F.style.display = "none"
                    }
                }
            }
        }
    } else {
        F = document.getElementById(C.editor_banned_tip);
        B = '<div class="editor_banned_tip_info">' + this._tip[H][0];
        B = B + (H == 1 ? "" : "<br />");
        if (!E) {
            var I = "<a href=\"#\" onclick=\"$.stats.sendRequest('fr=tb0_forum&st_mod=editor&st_type=count_action&st_value=login');TbCom.process('User', 'buildLoginFrame', null,null,null,'editor');return false;\">登录</a> | <a href=\"#\" onclick=\"$.stats.sendRequest('fr=tb0_forum&st_mod=editor&st_type=count_action&st_value=reg');TbCom.process('User','buildRegisterFrame',null,null,null,'editor');return false;\">注册</a>&nbsp;";
            B = B + (H == 1 ? "本吧发贴，请先 " : "你可以先 ") + I
        } else {
            var G = '<a href="#" onclick="showMemTip(this);return false;">什么是会员发贴？</a>';
            B = B + (H == 3 ? G : "")
        }
        B += "</div>";
        this.disable()
    }
    if (F) {
        F.innerHTML = B
    }
};
RichPostor.prototype._isExist = function(A) {
    if (!A) {
        return false
    }
    var B = document.getElementById(A);
    if (B) {
        return true
    }
    return false
};
RichPostor.prototype._initCaptchaAndSign = function(A) {
    var F = this._dom_id;
    var H = document.getElementById(F.post_login);
    var C = this._option;
    var D = this._data_editor;
    if (this._isExist(F.signPanel)) {
        if (D.is_login) {
            if (C.no_un == false || typeof C.no_un == "undefined") {
                if (H.checked) {
                    document.getElementById(F.signPanel).style.display = "";
                    SignNameApply.fillPanelId = F.signPanel;
                    SignNameApply.active()
                } else {
                    var B = document.getElementById(F.signPanel);
                    if (B) {
                        B.style.display = "none"
                    }
                }
            }
        } else {
            var B = document.getElementById(F.signPanel);
            if (B) {
                B.style.display = "none"
            }
        }
    }
    try {
        var G = function() {
            if (Captcha_requirement.need_captcha == 1) {
                A._captcha.show();
                $("#" + F.captcha_container).show()
            } else {
                A._captcha.hide();
                $("#" + F.captcha_container).hide()
            }
        };
        Captcha_requirement.antiProcess(G)
    } catch (E) {
    }
};
RichPostor.prototype._setDisable = function(B, C) {
    var A = document.getElementById(B);
    if (!A) {
        return
    }
    A.disabled = true;
    if (C) {
        $("#" + B).addClass("notPostbg")
    }
};
RichPostor.prototype._checkPostStatus = function() {
    var A = this;
    this._stopCheckPostStatus();
    this._check_post_thread = setTimeout(function() {
        var B = document.getElementById(A._dom_id("add_post_submit"));
        if (B && B.disabled) {
            $.stats.sendRequest("st_mod=editor&fr=tb0_forum&st_type=add_post")
        }
    }, 10 * 1000)
};
RichPostor.prototype._stopCheckPostStatus = function() {
    var A = this;
    if (A._check_post_thread) {
        clearTimeout(A._check_post_thread)
    }
};
RichPostor.prototype._doInputCount = function() {
    var A = this._editor;
    $.stats.sendRequest("st_mod=editor&fr=tb0_forum&st_type=count_input&num_music=" + A.getMusicNum() + "&num_image=" + A.getImageNum() + "&num_smiley=" + A.getSmileyNum() + "&num_flash=" + A.getFlashNum() + "&page_id=" + PageData.page_id + ((PageData.is_last_page && PageData.is_lzl == 0) ? "&last_page=1" : ""))
};
RichPostor.prototype.disable = function() {
    var D = this._dom_id;
    if (this._isExist(D.post_user)) {
        var B = document.getElementById(D.post_user);
        B.style.display = "none"
    }
    var A = this;
    this._setDisable(A._option.title, true);
    var C = document.getElementById(D.add_post_submit);
    C.className = "subbtn_bg_banned";
    C.disabled = true
};
RichPostor.prototype.setPostorData = function(A, C) {
    var B = this._data_postor;
    B[A] = C
};
RichPostor.prototype.getPostorData = function(A) {
    var B = this._data_postor;
    return B[A]
};
RichPostor.prototype.setPostorDataObj = function(A, C) {
    var B = this._data_postor;
    B[A] = $.json.encode(C)
};
RichPostor.prototype.getPostorDataObj = function(A) {
    var B = this._data_postor;
    return $.json.decode(B[A])
};
RichPostor.prototype._getData = function() {
    var C = this._data_postor;
    var G = this._data_editor;
    var B = this._dom_id;
    var D = this._option;
    if (this._option.title) {
        var J = document.getElementById(this._option.title);
        if (J) {
            C.title = $("#" + this._option.title).val()
        }
    }
    C.content = this._editor.getHtml();
    var E = G.is_login;
    var I = document.getElementById("useSignName");
    var A = document.getElementById(B.post_login);
    var F = document.getElementById("sign_id");
    if (E) {
        if (D.no_un == false || typeof D.no_un == "undefined") {
            if (A.checked && I && I.checked && F) {
                C.sign_id = F.value
            }
        }
    }
    if (E) {
        if (D.no_un == false || typeof D.no_un == "undefined") {
            if (!A.checked) {
                C.anonymous = 1
            }
        } else {
            C.anonymous = 1
        }
    }
    C.tbs = this._option.tbs;
    var H = this._captcha.getInputValue();
    if (H != "") {
        C.vcode = H
    }
    C.vcode_md5 = this._captcha._option.sign_str;
    return C
};
RichPostor.prototype.getEditor = function() {
    return this._editor
};
RichPostor.prototype._validator = function() {
    if (this._option.title) {
        var A = this._data_editor;
        if ((!A.is_notitle) && !this._validFrsPostTitle()) {
            return false
        }
    } else {
        var C = this._dom_id;
        var B = document.getElementById(C.coError);
        if (this._editor.isEmpty()) {
            B.style.display = "";
            B.innerHTML = "回复内容不能为空";
            B.className = "postErrorContent";
            this._editor.focus();
            return false
        }
    }
    if (!this._validRichEditorContent()) {
        return false
    }
    if (!this._captcha._validCaptcha()) {
        return false
    }
    return true
};
RichPostor.prototype._validRichEditorContent = function() {
    var C = this._dom_id;
    var H = this._data_editor;
    var B = document.getElementById(C.coError);
    var F = this._option.media_conf;
    var G = this._option;
    if (H.is_notitle) {
        if ($("#" + G.title).val().trim() == G.newTitieField_tip || $("#" + G.title).val().trim() == "") {
            this.setPostorData("tfrom", 2);
            $("#" + G.title).val("");
            if ((this._editor.isEmpty() || !this._editor.getHtml().replace(/<[^>]*>|(&nbsp;)|[\s　]*/g, ""))) {
                B.style.display = "";
                B.innerHTML = "发贴内容需包含文字";
                this._editor.focus();
                return false
            }
        }
    }
    var A = this._editor.getImageNum();
    if (A > F.imageLimite) {
        B.style.display = "";
        B.innerHTML = "抱歉，每层楼插入的图片不能超过" + F.imageLimite + "张，请修改后重新提交";
        this._editor.focus();
        return false
    }
    var D = this._editor.getFlashNum();
    if (D > F.flashLimite) {
        B.style.display = "";
        B.innerHTML = "抱歉，每层楼插入的视频不能超过" + F.flashLimite + "个，请修改后重新提交";
        this._editor.focus();
        return false
    }
    var E = this._editor.getSmileyNum();
    if (E > F.smileyLimite) {
        B.style.display = "";
        B.innerHTML = "抱歉，每层楼插入的表情不能超过" + F.smileyLimite + "个，请修改后重新提交";
        this._editor.focus();
        return false
    }
    var I = this._editor.getMusicNum();
    if (I > this._maxMusicNum) {
        B.style.display = "";
        B.innerHTML = "抱歉，每层楼插入的音乐数不能超过" + this._maxMusicNum + "个，请修改后重新提交";
        this._editor.focus();
        return false
    }
    return true
};
RichPostor.prototype._validFrsPostTitle = function() {
    var B = this._dom_id;
    var A = document.getElementById(B.title);
    if (A.value.trim() == "") {
        $("#" + B.tiError).html("标题不能为空").show();
        A.focus();
        return false
    } else {
        $("#" + B.tiError).hide()
    }
    return true
};
RichPostor.prototype._submit = function() {
    if (this._isPosting) {
        return
    }
    try {
        var F = this;
        var D = this._dom_id;
        var I = document.getElementById(D.captcha_container);
        var C = document.getElementById(D.signPanel);
        if (I.style.display == "none" && C.style.display == "none") {
            F._initCaptchaAndSign(F)
        }
    } catch (G) {
    }
    try {
        if (this._validator()) {
            this._isPosting = true;
            var D = this._dom_id;
            document.getElementById(D.add_post_submit).disabled = true;
            document.getElementById(D.add_post_submit).className = "subbtn_bg_banned";
            this._checkPostStatus();
            var A = this._option.url;
            try {
                var B = MousePwd.report();
                var H = MousePwd.time;
                var K = MOUSEPWD_CLICK;
                this.setPostorData("mouse_pwd", B.c);
                this.setPostorData("mouse_pwd_t", H);
                this.setPostorData("mouse_pwd_isclick", K)
            } catch (G) {
            }
            var E = this._getData();
            var J = this;
            PostHandler.post(A, E, function(L) {
                J.showAddResult(L)
            }, function(L) {
                Statistics.sendRequest("st_mod=editor&fr=tb0_forum&st_type=add_post_error&e_text=" + encodeURIComponent(L ? L.status : ""))
            });
            return false
        }
    } catch (G) {
    }
};
RichPostor.prototype.showAddResult = function(J) {
    this._stopCheckPostStatus();
    var B = this._dom_id;
    var K = this;
    var E = function(L) {
        switch (L.getActionType()) {
            case L.Action_FocusTitle:
                var N = B.title;
                var M = document.getElementById(N);
                if (M) {
                    M.focus();
                    M.value = M.value
                }
                break;
            case L.Action_FocusContent:
                K._editor.focus();
                break;
            case L.Action_ClearYZM:
                var O = $("#" + B.captcha_div).find("input")[0];
                if (O) {
                    O.value = "";
                    O.focus()
                }
                break;
            case L.Action_GoToHead:
                document.location.hash = "pgTop";
                break;
            case L.Action_FlushAndGoToHead:
                document.location.href = document.location.href.split("#")[0];
                break;
            default:
                break
        }
    };
    var H = null;
    try {
        H = J;
        Thread_add_result.init(H)
    } catch (D) {
        var F = D + "___";
        try {
            F += J.responseText;
            F = F.substring(0, 100)
        } catch (D) {
        }
        $.stats.sendRequest("st_mod=editor&fr=tb0_forum&st_type=add_post_json_error&e_text=" + encodeURIComponent(F))
    }
    var I = Thread_add_result.resultNo;
    if (I == 0) {
        var A = 500;
        K._doInputCount();
        setTimeout(function() {
            E(Thread_add_result)
        }, A)
    } else {
        if (Thread_add_result.isNeedWaitForCheck()) {
            K._doInputCount();
            var G = '<div style="margin: 0px 30px 0px 30px;font-size:14px;line-height:20px;text-align:left;font-family: &quot;宋体&quot;;"><table style="width:90%"><tbody><tr><td width="60"><img style="border:none;" src="http://static.tieba.baidu.com/tb/img/messageFace.gif"></td><td valign="middle" style="font-size:20px;line-height:22px;font-family: &quot;黑体&quot;;">等待审核...</td></tr></tbody></table>' + Thread_add_result.getMessage() + "</div>";
            var C = $.dialog.alert(G, {width: 380,height: 105,title: "发表贴子"});
            C.bind("onclose", function() {
                E(Thread_add_result);
                document.getElementById(B.add_post_submit).disabled = false;
                document.getElementById(B.add_post_submit).className = "subbtn_bg";
                K._isPosting = false;
                return true
            });
            document.getElementById("dialogBody").getElementsByTagName("input")[0].focus()
        } else {
            var G = '<div style="margin: 0px 30px 0px 30px;font-size:14px;line-height:20px;text-align:left;font-family: &quot;宋体&quot;;"><table style="width:90%"><tbody><tr><td width="60"><img style="border:none;" src="http://static.tieba.baidu.com/tb/img/errorFace.gif"></td><td valign="middle" style="font-size:20px;line-height:22px;font-family: &quot;黑体&quot;;">发贴失败</td></tr></tbody></table>' + Thread_add_result.getMessage() + "</div>";
            var C = $.dialog.alert(G, {width: 410,height: 95,title: "发表贴子"});
            C.bind("onclose", function() {
                E(Thread_add_result);
                document.getElementById(B.add_post_submit).disabled = false;
                document.getElementById(B.add_post_submit).className = "subbtn_bg";
                K._isPosting = false;
                return true
            });
            document.getElementById("dialogBody").getElementsByTagName("input")[0].focus()
        }
    }
};
String.prototype.getByteLength = function() {
    return this.replace(/[^\x00-\xff]/g, "mm").length
};
String.prototype.subByte = function(C) {
    if (this.getByteLength() <= C) {
        return this
    }
    for (var B = Math.floor((C = C - 2) / 2), A = this.length; B < A; B++) {
        if (this.substr(0, B).getByteLength() > C) {
            return this.substr(0, B)
        }
    }
    return this
};
var fe_format = function(C, B) {
    if (B) {
        if (typeof (B) == "object") {
            C = C.replace(/#\{([^\{\}]+)\}/g, function(D, F) {
                var E = B[F];
                if (typeof E == "function") {
                    E = E(F)
                }
                return typeof (E) == "undefined" ? "" : E
            })
        } else {
            if (typeof (B) != "undefined") {
                for (var A = arguments.length - 2; A > -1; A--) {
                    C = C.replace(new RegExp("#\\{" + A + "\\}", "g"), arguments[A + 1])
                }
            }
        }
    }
    return C
};
var PostHandler = {post: function(A, B, D, C) {
        $.ajax({type: "post",async: false,dataType: "json",url: A,data: B,success: function(E) {
                if (D) {
                    D(E)
                }
            }})
    },execute: function(B, C, D) {
        var A = FORUM_POST_URL[B];
        PostHandler.post(A, C, D)
    }};
var Captcha = {forum_id: "",forum_name_u: "",_container_ele: "captcha_container",_content_ele: "captcha_content",_error_ele: "captcha_error",_img_url: "/cgi-bin/genimg?",_audio_url: "/cgi-bin/genaudio?",_need_update: true,sign_str: "",getData: function() {
        AntiAnswer.antiProcess();
        var A = AntiAnswer.getVcodeUrl() + "&t=" + Math.random();
        $.ajax({url: A,dataType: "json",success: function(C) {
                var B = C.data;
                Captcha.sign_str = B.vcodestr
            },async: false});
        document.getElementById("vcode_md5").value = Captcha.sign_str
    },changeYImg: function(A) {
        var B = A;
        B.src = "http://static.tieba.baidu.com/tb/img/errorYimg.jpg"
    },init: function() {
        if (!this._need_update) {
            return
        }
        this._need_update = false;
        this.getData();
        var C = document.getElementById("captcha_img");
        var A = this._img_url + this.sign_str + "&t=" + Math.random();
        if (!C) {
            var B = document.getElementById("captcha_img_con");
            B.innerHTML = '<img onerror="Captcha.changeYImg(this);" id="captcha_img" src="' + A + '" style="margin-bottom:-3px;">'
        } else {
            C.src = A
        }
        document.getElementById(this._content_ele).style.display = ""
    },reload: function() {
        this.reset();
        this.init()
    },updateImage: function() {
        Captcha._need_update = false;
        var B = document.getElementById("captcha");
        B.value = "";
        B.focus();
        var A = this._img_url + this.sign_str + "&t=" + Math.random();
        document.getElementById("captcha_img").src = A
    },getAudio: function() {
        Captcha._need_update = false;
        document.getElementById("audio_img").style.display = "";
        var A = document.getElementById("captcha_audio");
        var B = this._audio_url + this.sign_str + "&t=" + Math.random();
        if (!document.all) {
            A.innerHTML = '<embed src="' + B + '" name="MediaPlayer" type="video/x-ms-wmv" autostart="1" showcontrols="1" allowscan="1" playcount="1" enablecontextmenu="0" height="0" width="0"></object>'
        } else {
            A.innerHTML = '<object height=0 width=0 classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6><param name="AutoStart" value="1"><param NAME="url" value="' + B + '"><param name="PlayCount" value="1">'
        }
        document.getElementById("captcha").focus()
    },show: function() {
        document.getElementById(Captcha._container_ele).style.display = "";
        var D = document.getElementById(Captcha._content_ele);
        if (D.innerHTML != "") {
            return
        }
        var C = '<table style="width:auto;"><tr><td id="captcha_img_con"></td><td valign="bottom">&nbsp;&nbsp;<a href="" onclick="Captcha.reload();return false;">看不清?</a>&nbsp;<a href="" id="listen_vcode"  onclick="Captcha.getAudio();return false;">收听验证码</a></td><td valign="bottom"><img id="audio_img" src="http://static.tieba.baidu.com/tb/img/audio.gif" style="display:none;vertical-align:top;"><span id="captcha_audio"></span></td></tr></table>';
        D.innerHTML = C;
        var B = document.getElementById("captcha_tip");
        var A = document.getElementById("captcha");
        var E = document.getElementById("listen_vcode");
        if (AntiAnswer.answer.showShenshou == 1 && B) {
            B.innerHTML = "为抵御爆吧挖坟危害，本吧吧主已暂时放出贴吧神兽--超级验证马。";
            if (A) {
                A.style.imeMode = "active"
            }
            if (E("listen_vcode")) {
                E("listen_vcode").style.display = "none"
            }
        }
    },hide: function() {
        document.getElementById(Captcha._container_ele).style.display = "none";
        document.getElementById(Captcha._content_ele).style.display = "none";
        document.getElementById("captcha").value = "";
        var A = document.getElementById(Captcha._error_ele);
        A.innerHTML = "";
        A.style.display = "none"
    },controlVerify: function(A) {
        if (A > 5000) {
            Captcha.show();
            return 1
        }
        AntiAnswer.antiProcess();
        if (PageData.need_captcha) {
            Captcha.show();
            return 1
        } else {
            Captcha.hide();
            return 0
        }
    },reset: function() {
        this._need_update = true
    }};
var AntiAnswer = {_is_anomy: 0,_vcodeUrl: "",answer: {antiNeedVerify: null,antiNeedVerifyA: null},post_type: "thread",forum_name_url: "",forum_id: 0,_ifHasKnowAnti: function(A) {
        switch (A) {
            case 1:
                return !(this.answer.antiNeedVerifyA == null);
                break;
            case 0:
            default:
                return !(this.answer.antiNeedVerify == null)
        }
    },setVcodeUrl: function(A) {
        this._vcodeUrl = A
    },getVcodeUrl: function() {
        return this._vcodeUrl
    },_getAntiAnswer: function() {
        var B = "/f/user/json_needvcode?rs1=" + (this._is_anomy == 1 ? "1" : "0") + "&rs10=" + (this.post_type == "thread" ? "1" : "0") + "&lm=" + this.forum_id + "&word=" + this.forum_name_url + "&t=" + Math.random();
        if (this.tid) {
            B += "&tid=" + this.tid
        }
        var A = this;
        $.ajax({url: B,dataType: "json",async: false,success: function(C) {
                A.handleAnswer(C.data)
            }});
        setTimeout(function() {
            if (!PageData.tbs_loaded) {
                TbUtil.requestTbs()
            }
        }, 30)
    },handleAnswer: function(A) {
        if (this._is_anomy == 1) {
            this.answer.antiNeedVerifyA = A.need
        } else {
            this.answer.antiNeedVerify = A.need
        }
        this.answer.showShenshou = A.open_shenshou;
        if (this.tid) {
            A.vcodeUrl += "&tid=" + this.tid
        }
        this.setVcodeUrl(A.vcodeUrl)
    },antiProcess: function() {
        this._is_anomy = 0;
        var B = document.getElementById("post_anonym");
        if (B && (B.checked)) {
            this._is_anomy = 1
        }
        var A = "";
        if (!this._ifHasKnowAnti(this._is_anomy)) {
            this._getAntiAnswer()
        }
        if (this._is_anomy) {
            A = this.answer.antiNeedVerifyA
        } else {
            A = this.answer.antiNeedVerify
        }
        if (A == "1") {
            PageData.need_captcha = 1
        } else {
            PageData.need_captcha = 0
        }
    },init: function(B, C, A) {
        this.forum_name_url = B;
        this.forum_id = C;
        if (A == "reply") {
            this.post_type = "reply";
            if (PageData.thread) {
                this.tid = PageData.thread.id
            }
        }
    }};
if (!UTSTART) {
    var UTSTART = new Date().getTime()
}
if (!MOUSEPWD_CLICK) {
    var MOUSEPWD_CLICK = 0
}
var MousePwd = (function() {
    var N = {ea: [],ma: []};
    var H = {};
    var C = false;
    var I = (new Date()).getTime();
    var O = {};
    var J = [];
    var Q = [];
    function K(U) {
        if (!U) {
            var U = window.event
        }
        var T = 0;
        var V = 0;
        if (U.pageX || U.pageY) {
            T = U.pageX;
            V = U.pageY
        } else {
            if (U.clientX || U.clientY) {
                T = U.clientX + document.body.scrollLeft;
                V = U.clientY + document.body.scrollTop
            }
        }
        return [T, V]
    }
    function B(T) {
        return T.offsetParent ? (T.offsetLeft + B(T.offsetParent)) : T.offsetLeft
    }
    function A(T) {
        return T.offsetParent ? (T.offsetTop + A(T.offsetParent)) : T.offsetTop
    }
    function P(T) {
        if (T.preventDefault) {
            T.preventDefault()
        } else {
            window.event.returnValue = false
        }
    }
    function S(Z) {
        Z.stopPropagation();
        var U = K(Z);
        var W = N[this.id];
        if (W) {
            if (!W.hover) {
                W.hover = true;
                W.count++
            }
        } else {
            var V = B(this);
            var X = A(this);
            var Y = V + this.offsetWidth;
            var T = X + this.offsetHeight;
            W = N[this.id] = {hover: true,count: 1,left: V,top: X,right: Y,buttom: T}
        }
        if (!W["mouse" + W.count]) {
            W["mouse" + W.count] = [];
            W["time" + W.count] = {start: (new Date()).getTime()};
            N.ma.push(W["mouse" + W.count])
        }
        W["mouse" + W.count].push(U);
        Q.push("1")
    }
    function R(V) {
        V.stopPropagation();
        var T = K(V);
        var U = N[this.className];
        if (U && U.hover) {
            if (T[0] && T[0] > U.left && T[0] < U.right && T[1] && T[1] > U.top && T[1] < U.buttom) {
                return
            }
            U["time" + U.count].end = (new Date()).getTime();
            U.hover = false
        }
        Q.push("0")
    }
    function E() {
        var T = N.ma.length;
        if (T > 0) {
            var U = N.ma[T - 1];
            return U[U.length - 1]
        }
    }
    function F() {
        var U = "";
        var T = Q.length;
        if (T > 10) {
            Q = Q.slice(T - 10)
        }
        U = Q.join(",");
        return U
    }
    function L() {
        if (C) {
            return H
        }
        var T = [E(), F(), (new Date()).getTime() - UTSTART, [screen.width, screen.height].join(",")].join("\t");
        H.c = D(T) + "," + I + "" + MOUSEPWD_CLICK;
        C = true;
        return H
    }
    function D(Y) {
        var T = [];
        var W = {};
        var X = I % 100;
        for (var V = 0, U = Y.length; V < U; V++) {
            var Z = Y.charCodeAt(V) ^ X;
            T.push(Z);
            if (!W[Z]) {
                W[Z] = []
            }
            W[Z].push(V)
        }
        return T
    }
    function G() {
        return this.className
    }
    function M(T) {
        this.elements = T;
        $.each(T, function(U, V) {
            $("." + V.toString()).bind("mouseover", S);
            $("." + V.toString()).bind("mouseout", R);
            O[V.toString()] = U
        });
        $("body").bind("click", function() {
            MOUSEPWD_CLICK = 1
        })
    }
    return {start: M,report: L,time: I}
})();
